--[[
弹头夺宝入口文件
]]

local DtdbUtilTest = false

--[[ 加载相关配置表和协议文件 ]]--
if not BulletTreasureConfig then loadConfig("BulletTreasureConfig") end
if not MonsterExchangeConfig and AppName=="xgame" then loadConfig("MonsterExchangeConfig") end
if not GameLimitConfig then loadConfig("GameLimitConfig") end
require_ex "games.dtdb.models.DtdbProtocol"
require_ex "games.dtdb.models.MonsterProtocol"

--[[ 创建类全局DB和Com对象 ]]--
Game.DtdbDB = require_ex("games.dtdb.models.DtdbDB")
Game.DtdbCom = require_ex("games.dtdb.models.DtdbCom")

--[[ 注册入口函数 ]]--
Game:registerAPI("game", "dtdb", function()
	Game.DtdbCom:onEnter()
end)


--[[ 注册相关API,方便其他模块调用 ]]--
local apiList = {
    
}
Game:registerAPIList(apiList)

--[[ 注册协议收包对应的解析表key ]]--
Game:registerParsePack(slg_cmd.Dtdb)
Game:registerParsePack(slg_cmd.monster)

--[[ 注册协议收包对应的解析函数 ]]--
local pushCallbackList = {
	{slg_cmd.Dtdb.leave[1],          handler(Game.DtdbCom, Game.DtdbCom.replyExit)},
	{slg_cmd.monster.leave[1],       handler(Game.DtdbCom, Game.DtdbCom.replyMonsterExit)},
	{slg_cmd.monster.debug[1],       handler(Game.DtdbCom, Game.DtdbCom.replyDebug)},
}
Game:registerPushMsg(pushCallbackList)

--[[ 注册进入大厅前需要执行的函数(获取相关数据) ]]--
local prepareList = {

}
Game:registerPrepareList(prepareList)

--[[ 单机模式生成测试数据 ]]--
if DEBUG_OFFLINE or DtdbUtilTest then
    Game.DtdbDB:testDataMonitor()
end